package collect;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Demo4 {
    public static void main(String[] agrs){
        Map<String,Object> maps=new HashMap<>();//<String,Object>利用了范型的原则
        maps.put("姓名","孙悟空");
        maps.put("年龄",23);
        maps.put("地址","昆明");
        System.out.println(maps.get("地址"));
        Set<String> keys=maps.keySet();
        for (String k:keys){//for each 的循环
            System.out.println(k+":"+maps.get(k));
        }
    }
}
